From: Alexander Larsson Date: Mon, 28 Feb 2011 19:06:58 +0000 (+0100) Subject: Add and export shell_global_get_primary_monitor_index X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8630 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d8bd9f5a66609ab36bfcb7dc114145049adb7af4;p=gnome-shell.git Add and export shell_global_get_primary_monitor_index https://bugzilla.gnome.org/show_bug.cgi?id=609258 --- diff --git a/src/shell-global.c b/src/shell-global.c index 2d55033fa..32836cba5 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -1410,6 +1410,23 @@ shell_global_get_primary_monitor (ShellGlobal *global) return meta_rectangle_copy (&rect); } +/** + * shell_global_get_primary_monitor_index: + * @global: the #ShellGlobal + * + * Gets the index of the primary monitor (the one that the + * panel is on). + * + * Return value: the index of the primary monitor + */ +int +shell_global_get_primary_monitor_index (ShellGlobal *global) +{ + MetaScreen *screen = shell_global_get_screen (global); + + return meta_screen_get_primary_monitor (screen); +} + /** * shell_global_get_focus_monitor: * @global: the #ShellGlobal diff --git a/src/shell-global.h b/src/shell-global.h index f05391915..40f9a8f9b 100644 --- a/src/shell-global.h +++ b/src/shell-global.h @@ -100,6 +100,7 @@ void shell_global_format_time_relative_pretty (ShellGlobal *global, guint delta, GSList *shell_global_get_monitors (ShellGlobal *global); MetaRectangle *shell_global_get_primary_monitor (ShellGlobal *global); +int shell_global_get_primary_monitor_index (ShellGlobal *global); MetaRectangle *shell_global_get_focus_monitor (ShellGlobal *global); void shell_global_get_pointer (ShellGlobal *global,